Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize DateToString converter #40

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Optimize DateToString converter #40

merged 3 commits into from
Feb 1, 2024

Conversation

vitalyisaev2
Copy link
Member

@vitalyisaev2 vitalyisaev2 commented Feb 1, 2024

Provided unsafe-based implementation of DateToString converter:

go test -bench="DateToString" -memprofile profile.out -benchmem -v ./app/server/conversion
(...)
cpu: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
BenchmarkDateToStringConverter
BenchmarkDateToStringConverter/Default
BenchmarkDateToStringConverter/Default-16               17300325                67.20 ns/op           16 B/op          1 allocs/op
BenchmarkDateToStringConverter/Unsafe
BenchmarkDateToStringConverter/Unsafe-16                25947836                43.99 ns/op           16 B/op          1 allocs/op

Benchmarking request: SELECT l_shipdate FROM lineitem in PostgreSQL 15.3. Throughput measurements:

Before

  • 60,4 MB/sec
  • 3.95 * 10^6 Rows/sec

After:

  • 69.8 MB/sec (+15.6%)
  • 4.57 * 10^6 Rows/sec (+15.7%)

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (42f8c26) 64.52% compared to head (24ea4ec) 64.77%.

Files Patch % Lines
app/server/datasource/rdbms/ydb/type_mapper.go 78.43% 8 Missing and 3 partials ⚠️
app/server/config.go 33.33% 6 Missing ⚠️
.../server/datasource/rdbms/postgresql/type_mapper.go 86.66% 3 Missing and 1 partial ⚠️
app/server/conversion/converters_default.go 96.07% 2 Missing ⚠️
app/server/conversion/factory.go 75.00% 1 Missing ⚠️
app/server/service_pprof.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
+ Coverage   64.52%   64.77%   +0.24%     
==========================================
  Files          59       61       +2     
  Lines        3146     3239      +93     
==========================================
+ Hits         2030     2098      +68     
- Misses        944      965      +21     
- Partials      172      176       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vitalyisaev2 vitalyisaev2 merged commit c7a847b into main Feb 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants